package com.seafood.dto;

import lombok.Data;

import java.math.BigDecimal;

/**
 * 支付响应DTO
 */
@Data
public class PaymentResponseDTO {
    
    private String paymentId; // 支付订单ID
    
    private String orderNumber; // 原订单号
    
    private BigDecimal amount; // 支付金额
    
    private String paymentMethod; // 支付方式
    
    private String status; // 支付状态：PENDING, SUCCESS, FAILED, CANCELLED, REFUNDED
    
    private String payUrl; // 支付链接（用于跳转支付）
    
    private String qrCode; // 支付二维码内容
    
    private String tradeNo; // 第三方交易号
    
    private String message; // 响应消息
    
    private Boolean success; // 是否成功
    
    private String createdAt; // 创建时间
    
    private String paidAt; // 支付时间
    
    private String refundedAt; // 退款时间
    
    private String refundReason; // 退款原因
    
    public static PaymentResponseDTO success(String paymentId, String payUrl) {
        PaymentResponseDTO response = new PaymentResponseDTO();
        response.setPaymentId(paymentId);
        response.setPayUrl(payUrl);
        response.setSuccess(true);
        response.setStatus("PENDING");
        response.setMessage("支付订单创建成功");
        return response;
    }
    
    public static PaymentResponseDTO error(String message) {
        PaymentResponseDTO response = new PaymentResponseDTO();
        response.setSuccess(false);
        response.setStatus("FAILED");
        response.setMessage(message);
        return response;
    }
}